home *** CD-ROM | disk | FTP | other *** search
- Path: news.sprintlink.net!datalytics!usenet
- From: Rob Stewart <stew@datalytics.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Protected functions
- Date: Tue, 26 Mar 1996 17:12:07 -0500
- Organization: Datalytics, Inc
- Message-ID: <31586BB7.347A@datalytics.com>
- References: <3155636F.3461@clubi.ie> <4j63qe$eq7@news1.h1.usa.pipeline.com>
- NNTP-Posting-Host: 204.62.224.71
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (WinNT; I)
-
- Pete Grant wrote:
- >
- > On Mar 24, 1996 14:59:59 in article <Protected functions>, 'BRUCE
- > <jbruce@clubi.ie>' wrote:
- >
- >
- > >Can any one tell me what a protected function of a class is ?
- > >
- > A protected member function is just like any other member function
- > except that it may be called only by:
- >
- > 1. member functions of the class.
- > 2. member functions of non-privately derived classes.
-
- Close, but no cigar. According to ARM 11.2, "If a class is
- declared to be a base class for another class using the private
- access specifier, the public and protected members of the base
- class are private members of the derived class." In other
- words, the public and protected members of the base class are
- accessible to the derived class even with private inheritance.
- Private inheritance only serves to prevent further derived
- classes from seeing that private base class and its members.
-
- > 3. friends of the class.
- >
- > There's a little more detail, but the above is a good starting
- > point. BTW, need I say that #2 is only for classes derived
- > from the class which has the protected member in question?
- >
-
- --
- Robert Stewart | My opinions are usually my own.
- Datalytics, Inc. | stew@datalytics.com
-